import threading
import time

class Batiment:
    def __init__(self, nom, idBatiment, iDjoueur, posx, posy, vie):
        self.nom = nom                  
        self.idBatiment = idBatiment           
        self.idJoueur = iDjoueur
        self.posx = posx             
        self.posy = posy
        self.vie = vie            
        
        self.taillex = 0
        self.tailley = 0                        
        self.armure = 0                  
        self.costmin = 0                
        self.costfood = 0                
        self.costener = 0                
        self.constructionTime = 0
        self.stadeConstruction = 0
        
        self.isProducing = False
        self.canBeRepaired = False
        # caserne, Rafinerie, mine
        
    def creationBatiment(self, name):
        self.name = name

    def tempConstruction(self, temp):
        nbrTemp = 0   
        if (temp == 10):
            nbrTemp = 10.0
    
    def recolteMinerai(self, bloc, joueur):
        bloc.qte = bloc.qte - 10
        joueur.mineraux += 10
                
